﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace QuangMobile
{
    public partial class UCProductItem : System.Web.UI.UserControl
    {
        private string _ProductImage;
        private string _ProductTitle;
        private double _ProductPrice;
        private string _ProductComment;
        private int _ProductID;

        public int ProductID
        {
            get { return _ProductID; }
            set { _ProductID = value; }
        }

        public string ProductComment
        {
            get { return _ProductComment; }
            set { _ProductComment = value; }
        }

        public double ProductPrice
        {
            get { return _ProductPrice; }
            set { _ProductPrice = value; }
        }

        public string ProductTitle
        {
            get { return _ProductTitle; }
            set { _ProductTitle = value; }
        }

        public string ProductImage
        {
            get { return _ProductImage; }
            set { _ProductImage = value; }
        }

        public UCProductItem() { }
        public UCProductItem(string pImage, string pTitle, double pPrice, string pComment)
        {
            _ProductImage = pImage;
            _ProductTitle = pTitle;
            _ProductPrice = pPrice;
            _ProductComment = pComment;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            productImage.Text = "<a href='ViewProduct.aspx?ID=" + _ProductID + "'><img width='100px' title=" + _ProductTitle + " src=" + _ProductImage + "></a>";
            productTitle.Text = _ProductTitle;
            productTitle.NavigateUrl = "ViewProduct.aspx?ID=" + _ProductID;
            productPrice.Text = "<span class='product-price'>" + _ProductPrice.ToString("0,000") + " vnd</span>";
            productComment.Text = _ProductComment;
        }
    }
}